<?php
/**
 * 处理和数字相关的业务逻辑
 */

namespace app\common\lib;


class Num
{
    /**
     * 短信验证码的长度 4或6
     * @param int $len
     * @return int
     */
    public static function getCodeLen($len = 4) {
        $code = rand(1000, 9999);
        if ($len == 6) {
            $code = rand(100000, 999999);
        }
        return $code;
    }
}